/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package configuraciones;

import org.cip.esymons.general.bc.*;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.general.be.Configuracion;

/**
 * @author Lizardo Rios
 */
public class ConfiguracionReporteDelegate {
    public ConfiguracionFacadeLocal local;

    public ConfiguracionReporteDelegate() {
        local=lookupConfiguracionFacade();
    }

    public void create(Configuracion configuracion) throws Exception {
        local.create(configuracion);
    }

    public void edit(Configuracion configuracion) throws Exception {
        local.edit(configuracion);
    }

    public void remove(Configuracion configuracion) throws Exception {
        local.remove(configuracion);
    }

    public Configuracion find(Object id) throws Exception {
        return local.find(id);
    }

    public Configuracion findActive(Integer plataforma) throws Exception {
        return local.findActive(plataforma);
    }

    public List<Configuracion> findAll() throws Exception {
        return local.findAll();
    }

    private ConfiguracionFacadeLocal lookupConfiguracionFacade() {
        try {
            Context c = new InitialContext();
            return (ConfiguracionFacadeLocal) c.lookup("java:comp/env/ConfiguracionFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }

    

}
